﻿using DAL;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public class WiliteBLL
    {
        public WilltellDAL WilltellDAL { get; }

        public WiliteBLL(WilltellDAL willtellDAL)
        {
            WilltellDAL = willtellDAL;
        }

        /// <summary>
        /// 添加会告
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public int WillteAdd(WilltellModel info)
        {
            try
            {
                return WilltellDAL.WillteAdd(info);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 逻辑删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int willtellDelete(int id)
        {
            try
            {
                return WilltellDAL.willtellDelete(id);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int willtellDeleteAll(string ids)
        {
            try
            {
              return WilltellDAL.willtellDeleteAll(ids);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 批量修改状态
        /// </summary>
        /// <param name="ids"></param>
        /// <param name="state"></param>
        /// <returns></returns>
        public int willtellUpdateAll(string ids, int state)
        {
            try
            {
               return WilltellDAL.willtellUpdateAll(ids, state);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// id查询(反填)
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public WilltellModel GetwillteId(int id)
        {
            try
            {
                return WilltellDAL.GetwillteId(id);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 修改会告信息
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public int willteUpdate(WilltellModel info)
        {
            try
            {
                return WilltellDAL.willteUpdate(info);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 显示查询分页
        /// </summary>
        /// <param name="totalCount"></param>
        /// <param name="totalPage"></param>
        /// <param name="pageindex"></param>
        /// <param name="pageSize"></param>
        /// <param name="WiteTitle"></param>
        /// <param name="WiteType"></param>
        /// <returns></returns>
        public List<WilltellModel> GetWiteList(out int totalCount, out int totalPage, int pageindex = 1, int pageSize = 2, string? WiteTitle = "", int? WiteType = null)
        {
            try
            {
               return WilltellDAL.GetShopList(out totalCount, out totalPage, pageindex, pageSize, WiteTitle, WiteType);

            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
